# -*- coding:utf-8 -*-
from unti.sql_helper import mysqlhelper

class admin(object):
    def __init__(self):
        self.__helper = mysqlhelper()
        
    def get_name(self,id):
        sql = 'select * from user where id = %s'
        params = (id,)
        return self.__helper.get_dict(sql, params)
    def check_user(self,username,password):
        sql = 'select * from user where name = %s and password = %s'
        params = (username,password)
        result = self.__helper.get_one(sql, params)
        if result:
            print '登录成功'
        else:
            print '用户名不存在或密码错误'